﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminMaster.master" AutoEventWireup="true" CodeFile="CandidateByRegNum.aspx.cs" Inherits="Admin_CandidateByRegNum" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <style type="text/css">
        .Background {
            background-color: Black;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }

        .Popup {
            background-color: #FFFFFF;
            border-width: 3px;
            border-style: solid;
            border-color: black;
            padding-top: 5px;
            padding-left: 5px;
            width: 650px;
            height: 350px;
        }

        .lbl {
            font-size: 16px;
            font-style: italic;
            font-weight: bold;
        }
    </style>
    <script type="text/javascript">
        function validateRemark() {
            alert("nilesh");
            var enteredValue = $("#txtRemark");

            if (length(enteredValue) > 0) {
                alert("Start Date not valid");
                enteredValue.focus();
                return false;
            }
        }
        function UserDeleteConfirmation() {
            return confirm("Are you sure you want to delete this user?");
        }
        function UserDeletePhysicalConfirmation() {
            return confirm("Are you sure you want to delete this user physically?");
        }
    </script>

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>

    <table style="width: 100%" id="TABLE1" cellspacing="1" cellpadding="1" border="0">
        <tbody>
            <tr>
                <td style="height: 30px; text-align: center">
                    <table id="TABLE3" style="vertical-align: middle; width: 100%;">
                        <tbody>
                            <tr>
                                <td width="30%"></td>
                                <td width="70%"></td>
                            </tr>
                            <tr>
                                <td align="left" colspan="2" style="text-align: left;">
                                    <h3>Candidate Deletion</h3>
                                </td>
                            </tr>
                            <tr>
                                <td width="30%"></td>
                                <td width="70%"></td>
                            </tr>
                            <tr>
                                <td width="30%" align="right" class="auto-style3-1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                             Candidate Registration Number :<font color="red">*</font>&nbsp;
                                </td>
                                <td align="left" width="70%">
                                    <asp:TextBox ID="txtRegNum" runat="server" Width="245px" MaxLength="35" placeholder="Reg. number"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtRegNum" ErrorMessage="Enter Registration Number" ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td align="left">
                                    <asp:Label ID="lblErrorMsg" runat="server" Visible="false" ForeColor="Red" /></td>

                            </tr>
                            <tr>
                                <td></td>
                                <td align="left">
                                    <asp:Button ID="btnSearchRegId" runat="server" Text="Search" OnClick="btnSearchRegId_Click" /></td>
                            </tr>

                        </tbody>
                    </table>
                </td>
            </tr>

            <tr>
                <td>
                    <br />
                </td>
            </tr>

            <tr>
                <td align="center">
                    <div class="grd_table" style="overflow-x: auto; width: 950px;">

                        <asp:GridView ID="gvByRegID" runat="server" DataKeyNames="CandidateID" Width="70%"
                            AutoGenerateColumns="False" ForeColor="#333333" HeaderStyle-Height="30px" 
                             OnRowCommand="gvByRegID_RowCommand">
                            <Columns>


                                <asp:BoundField DataField="CandidateID" HeaderText="CandidateId" Visible="false" />
                                <asp:BoundField DataField="RegistrationNo" HeaderText="&nbsp;Registration No" />

                                <asp:BoundField DataField="CandidateName" HeaderText="&nbsp;Candidate Name" />
                                <asp:BoundField DataField="AccrediationType" HeaderText="&nbsp;Candidate Type" />
                                <%--<asp:HyperLinkField DataNavigateUrlFields="CandidateID" DataNavigateUrlFormatString="~/home/CandidateDetailsReg.aspx?CandidateID={0}"
                                    HeaderText="&nbsp;View" Text="Details" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="left" />--%>
                                <%-- <asp:TemplateField HeaderText="&nbsp;Delete">
                                   <ItemStyle Width="12%" HorizontalAlign="left" />
                                    <ItemTemplate>
                                    <asp:LinkButton ID="lnkDelete" CommandArgument='<%# Eval("CandidateId") %>' CommandName="Delete" runat="server">Delete</asp:LinkButton>
                                    </ItemTemplate>
                                    </asp:TemplateField>--%>
                                <asp:TemplateField ItemStyle-Width="10%" AccessibleHeaderText="View">
                                    <ItemTemplate>
                                        <asp:HyperLink runat="server"
                                            NavigateUrl='<%# GetViewtUrl(Eval("CandidateID"))%>'
                                            Text="Details"></asp:HyperLink>
                                        <%--<asp:HyperLinkField DataNavigateUrlFields="CandidateID" DataNavigateUrlFormatString="~/home/CandidateDetailsReg.aspx?CandidateID={0}"
                            HeaderText="&nbsp;&nbsp;View" Text="Details" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="left" />--%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="&nbsp;Logical Delete">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnPopUp" runat="server" CommandName="POPUP" Text="Delete"></asp:LinkButton>
                                        <%--<asp:LinkButton ID="lnkDel" Text="Delete" 
                                  OnClick="lnkDel_Click" runat="server"></asp:LinkButton>--%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="IsDeleted" HeaderText="&nbsp;IsDeleted" Visible="false" />
                                <asp:BoundField DataField="DeletedDate" HeaderText="&nbsp;Deleted Date" Visible="false" />
                                <asp:BoundField DataField="CandidateRemark" HeaderText="&nbsp;Remarks" Visible="false" />
                                <asp:TemplateField HeaderText="&nbsp;Physical Delete">
                                    <ItemTemplate>
                                            <asp:LinkButton ID="lnkDel" Text="Delete" 
                                            CommandArgument='<%# Eval("RegistrationNo") %>'  OnClientClick="if ( ! UserDeletePhysicalConfirmation()) return false;" CommandName="DeleteAll"
                                            runat="server" OnClick="lnkDel_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#E2DED6" ForeColor="blue" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#CCCCCC" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />

                            <EmptyDataTemplate>No Records Found </EmptyDataTemplate>
                        </asp:GridView>
                        <br />
                    </div>
                </td>
            </tr>

            <tr>
                <td align="right">
                    <input id="hdnInput" runat="server" type="hidden" />
                    <asp:Button runat="server" ID="btnAddNew1" Visible="false" />
                    <asp:Button runat="server" ID="btnNoUse" Text="" Style="display: none;" />
                </td>
            </tr>
        </tbody>
    </table>
    <!--Panel to Remove record-->

    <cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="btnNoUse"
        BackgroundCssClass="Background">
    </cc1:ModalPopupExtender>

    <asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" BorderWidth="5px">
        <table style="padding: 0px 0px 0px 0px; border: 0px; border-color: red; height: 90%; width: 90%" border="0">
            <tr>
                <td valign="top" colspan="2">&nbsp;<h4>Candidate Deletion</h4>
                </td>
            </tr>

            <tr>
                <td valign="top" align="left">&nbsp;    
                    Enter Remark :
                </td>
                <td valign="top" align="left">
                    <asp:TextBox ID="txtRemark" TextMode="MultiLine" runat="server" placeholder="Remark" MaxLength="250" Height="100px" Width="350px"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="reqRemark" ValidationGroup="grpRemark" Display="Dynamic" ForeColor="red" ControlToValidate="txtRemark" runat="server" ErrorMessage="Enter Remark"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td></td>
                <td valign="top" align="left">
                    <asp:Button ID="BtnDeleteReg" ValidationGroup="grpRemark" runat="server" OnClick="btnDeleteReg_Click" Text="Submit" />&nbsp;&nbsp;<asp:Button ID="btnCancel" runat="server" Text="Close" OnClick="btnCancel_Click" />
                </td>

            </tr>
        </table>
        <br />
    </asp:Panel>

    <%--<ajaxToolkit:ModalPopupExtender ID="mpe1" runat="server" 
TargetControlID="btnAddNew1" PopupControlID="panelAddNew" 
RepositionMode="RepositionOnWindowResizeAndScroll" DropShadow="true" 
PopupDragHandleControlID="panelAddNewTitle" 
BackgroundCssClass="modalBackground"  ></ajaxToolkit:ModalPopupExtender>
  <asp:Panel ID="panelAddNew" runat="server" style="display:none; 
  background-color:gray;" ForeColor="Black" 
  Width="500" Height="210">
            <asp:Panel ID="panelAddNewTitle" runat="server" 
            style="cursor:move;font-family:Tahoma;padding:2px;" 
            HorizontalAlign="Center" BackColor="Blue" 
            ForeColor="White" Height="25" ><b>Add New</b>
            </asp:Panel>
            <table width="100%" style="padding:5px">
                <tr>
                <td colspan="3">
                    <asp:Label ID="lblStatus1" runat="server">
                    </asp:Label>
                </td>
                </tr>
                <tr>
                    <td><b>Enter Remark For Candidate</b></td>
                    <td><b>:</b></td>
                    <td><asp:TextBox ID="txtName1" runat="server">
                    </asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfv1" runat="server" 
                        ErrorMessage="Enter Remark " Display="None"  
                        ControlToValidate="txtName1"  ValidationGroup="add">
                        </asp:RequiredFieldValidator>
                        <ajaxToolkit:ValidatorCalloutExtender ID="vce1" 
                        TargetControlID="rfv1" runat="server">
                        </ajaxToolkit:ValidatorCalloutExtender>
                    </td>
                </tr>
                           </table>
            <br />
                <div align="center">
                <asp:Button ID="btnAddNew2" runat="server" 
                Width="70" Text="OK" 
                OnClick="btnAddNew_Click"  ValidationGroup="add"/>
                &nbsp;
                <asp:Button ID="btnCancel1" runat="server" 
                Width="70" Text="Cancel" 
                CausesValidation="false" OnClick="Cancel_Click" 
                ValidationGroup="add"/>
            </div>
        </asp:Panel>--%>
    <!--Panel to Edit record-->
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .auto-style6 {
            width: 17%;
        }

        .auto-style7 {
            width: 335px;
        }

        .modalBackground {
            background-color: silver;
            opacity: 0.7;
        }

        .modalBackground {
            background-color: Gray;
            filter: alpha(opacity=80);
            opacity: 0.8;
            z-index: 10000;
        }
    </style>
</asp:Content>


